import { createContext, useState } from "react";

export const Theme = {
  dark: "dark",
  light: "light",
};

const ThemeContext = createContext({ theme: Theme.dark });

export const ThemeProvider = ({ children }) => {
  const [theme, setTheme] = useState(Theme.light);
  const store = { theme, setTheme };

  return (
    <ThemeContext.Provider value={store}>{children}</ThemeContext.Provider>
  );
};

export default ThemeContext;
